#pragma once

#include "IGUIElement.h"
#include "GUIListBoxItem.h"
#include "Functor.h"

class GUIListBox : public IGUIElement
{
public:
	GUIListBox();

	void Paint();
	bool ReceiveEvent( IEvent& event );
	void Location( Maths::Point<unsigned int>& location );
	void ParentLocation( Maths::Point<unsigned int>& location );

	void AddListBoxItem( Pointer<GUIListBoxItem>& item );
	void ClearListBoxItems();
	void RemoveListBoxItem( unsigned int itemIndex );
	void RemoveSelected();

	void Select( unsigned int select );
	void Select( GUIListBoxItem* item );
	unsigned int SelectedRow() const;
	Pointer<GUIListBoxItem> Selected() const;
	void OnSelectedChangedFunction( Pointer<Functor>& func );
protected:
	HashedString m_font;
	unsigned int m_fontColor;
	Pointer<Functor> m_onSelectedChangedFunction;
	GUIListBoxItem::Vector_t m_listItems;
	int m_selectedIndex;
};